/*
 * Copyright (C) 2011 Johan Kannala
 *
 * Licensed under the MIT License. You can find a copy of the License at in the
 * license.txt file.
 */
package com.joppe.vocabtutor;

import android.content.Context;
import android.database.Cursor;
import android.view.*;
import android.widget.*;

/**
 * @author joppe
 *
 */
public class TranslationListCursorListAdapter extends CursorAdapter {

	/**
	 * @param context
	 * @param c
	 */
	public TranslationListCursorListAdapter(Context context, Cursor c) {
		super(context, c);
	}

	/* (non-Javadoc)
	 * @see android.widget.CursorAdapter#bindView(android.view.View, android.content.Context, android.database.Cursor)
	 */
	@Override
	public void bindView(View view, Context context, Cursor cursor) {
        ((TextView) view).setText(cursor.getString(0));
	}

	/* (non-Javadoc)
	 * @see android.widget.CursorAdapter#newView(android.content.Context, android.database.Cursor, android.view.ViewGroup)
	 */
	@Override
	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		TextView translationFld = new TextView(context);
		bindView(translationFld, context, cursor);
		return translationFld;
	}
}